/**
 * 
 */
package com.haisen.lee.domain;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.haisen.lee.util.SystemParameter;

/**
 * @author Haisen Lee
 * 
 */
public class DirectoryMap {

	private static ConcurrentHashMap<String, List<DirectoryItem>> directoryMap = new ConcurrentHashMap<String, List<DirectoryItem>>();;

	static {
		Map<String, String> systemParameters = SystemParameter
				.getAllParameters();
		Iterator<Map.Entry<String, String>> iterator = systemParameters
				.entrySet().iterator();
		for (; iterator.hasNext();) {
			Map.Entry<String, String> entry = iterator.next();
			if (entry.getKey() != null && entry.getKey().length() > 0) {
				if (entry.getKey().contains("needParser")) {
					String loadValue = entry.getValue();
					if (loadValue != null && loadValue.length() > 0) {
						directoryMap.put(loadValue,
								new ArrayList<DirectoryItem>());
					}
				}
			}
		}
	}

	/**
	 * 
	 */
	public DirectoryMap() {
		super();
	}

	public static ConcurrentHashMap<String, List<DirectoryItem>> getDirectoryMap() {
		return directoryMap;
	}

}
